#include<stdio.h>
#include<string.h>

#include "quiz_lib.h"
#include "cmd_line_ui.h"

int get_url(struct quiz *local_quiz)
{
    //printf("Enter Quiz URL: ");
    strcpy((*local_quiz).url, "/Users/robert/statequiz/trunk/state_quiz.xml");
    //fgets((*local_qui)z.url, 100, stdin);
    return 0;
}

int print_quiz_information(struct quiz *local_quiz)
{
    printf(" Quiz Location:           %s\n", (*local_quiz).url);
    //printf(" Name:          %s\n\n", (*local_quiz).name);
    return 0;
}

int ask_question(const char *question,char *supplied_answer)
{
        printf("- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \n");
        printf("%s\nAnswer:  ", question);
        if(fgets(supplied_answer, MAX_ANSWER_SIZE, stdin) == NULL)
            return(1);
        else
            return(0);
}

void print_success() {
    printf("Correct\n");
}

void print_failure(char *correct_answer) {
    printf("Incorrect, the answer was %s\n", correct_answer);
}

void print_score(struct score *current_score)
{
    printf("* * * * * * * * * * End of Quiz * * * * * * * * * *\n");
    printf("You got %d out of %d correct:  ", current_score->awarded, current_score->possible);
    printf("%d%%\n", (current_score->awarded * 100) / current_score->possible);
}
      
